﻿<UserControl x:Class="ExORMDesginer.UserControls.ParametersListBoxView"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
	xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
	mc:Ignorable="d"  d:DesignHeight="600" d:DesignWidth="800" xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation">
    <Grid >
        <telerik:RadGridView Foreground="WhiteSmoke"   AutoGenerateColumns="False" Grid.Row="1"  Margin="5,5,5,5" Name="dataGrid1"  ItemsSource="{Binding Model.Parameters,Mode=TwoWay,IsAsync=True}" FontFamily="Microsoft YaHei"  CanUserReorderColumns="False" HorizontalGridLinesBrush="#FFE8E5E5"  VerticalGridLinesBrush="#FFEFE5E5"  CanUserDeleteRows="False" CanUserResizeRows="False" CanUserSortColumns="False" DataLoadMode="Asynchronous" ShowGroupPanel="False" RowIndicatorVisibility="Collapsed">
            <telerik:RadGridView.Columns>

                <telerik:GridViewDataColumn   Header="名称" DataMemberBinding="{Binding Name}" EditTriggers="None" Width="120" />
                <telerik:GridViewDataColumn  Header="类型"  DataMemberBinding="{Binding ParameterType,Mode=TwoWay}" Width="110">
                    <telerik:GridViewDataColumn.CellTemplate>
                        <DataTemplate>
                            <telerik:RadComboBox  Command="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type UserControl}}, 
                                 Path=DataContext.ParameterTypeChangedCommand}" CommandParameter="{Binding .}"
                                 Margin="3" DisplayMemberPath="Value"
                                 SelectedItem="{Binding ParameterType, Mode=TwoWay}"
                                 ItemsSource="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type UserControl}}, 
                                 Path=DataContext.Model.ParameterTypeList}" />
                        </DataTemplate>
                    </telerik:GridViewDataColumn.CellTemplate>
                </telerik:GridViewDataColumn>
            
                <telerik:GridViewDataColumn Header="值" DataMemberBinding="{Binding Value, Mode=TwoWay}" MinWidth="100" Width="150" EditTriggers="CellClick" />

                <telerik:GridViewDataColumn Header="备注" DataMemberBinding="{Binding Memo,Mode=TwoWay}" EditTriggers="CellClick" Width="*"/>
            </telerik:RadGridView.Columns>
        </telerik:RadGridView>
    </Grid>
</UserControl>
